import style from "./new_author.module.css";
import { IAuthor, IAuthorList } from "../../Book";
import { NavLink } from "react-router-dom";
import EbookTil from "../ebookTil";
const { all, authorImg } = style;
// interface IProp{
//   authorList:IAuthorList
// }

export default function NewAuthor(props:any) {

interface IProp {
  authorList: IAuthorList
}
  // console.log(authorList);
  let til =props.authorList.title
  let list = props.authorList.list

  // console.log(props);
  
  return (
    <div className={all}>
      <EbookTil title={til} />
      <ul>
        {list?.map((item: any) => (
          <NavLink to={"/authordetail/" + item.id}>
            <li key={item.id}>
              <div className={authorImg}>
                <div ><img src={item.avatar_url} alt="" /></div>
                <dl>
                  <dt>{item.name}</dt>
                  <dd>{item.label}</dd>
                </dl>
              </div>
              <p>作品：{item.workTil}</p>

            </li>
          </NavLink>
        ))}
      </ul>
    </div>
  );
}
